package com.test.es7.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Book {

    @JsonIgnore
    private Long id;

    private String name;

    private String author;

    @JsonProperty("on-sale")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date onSale;

    private Integer count;

    private String descr;
}
